#include<iostream>
#include<string>
#include "BankAccount.h"

//q1

using namespace std;

Account::Account() :name("none"), account("none"), m_money(0)
{
	cout << "This is default constract!" << endl;
}

Account::Account(const string& s, const string& a, int money)
{
	name = s;
	account = a;
	m_money = money;

	cout << "create completed!" << endl;
}

Account::~Account()
{
	cout << "delete completed!" << endl;
}

void Account::show() const
{
	cout << "name: " << name << " account: " << account << " money: " << m_money << endl;
	cout << "show completed!" << endl;
}

void Account::push(int cash)
{
	if (cash > 0)
	{
		m_money += cash;
	}
	cout << "push completed!" << endl;
	return;
}

void Account::get(int cash)
{
	if (m_money >= cash)
	{
		m_money -= cash;
		cout << "get completed!" << endl;
	}
	else
	{
		cout << "money is not enough!" << endl;
	}
	return;
}